package com.ps.property;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.util.Date;

@ApiModel(description = "系统用户信息")
@Data
@NoArgsConstructor
public class SystemUserVo {
  @ApiModelProperty(value = "系统用户ID",required = true)
//  @NotBlank(message = "系统用户ID不能为空")
  private int adminId;

  @ApiModelProperty(value = "用户名",required = true)
  @NotBlank(message = "用户名不能为空")
  private String adminName;

  @ApiModelProperty(value = "密码",required = true)
  @NotBlank(message = "密码不能为空")
  @Size(min = 6,max = 10,message = "密码长度必须是6-10个字符")
  private String adminPassword;

  @ApiModelProperty(value = "用户昵称",required = true)
  @NotBlank(message = "用户昵称不能为空")
  private String adminNickname;

  @ApiModelProperty(value = "用户状态(1.启用 2.禁用)",required = true)
  @NotNull(message = "用户状态不能为空")
  private int adminStatus;

  @ApiModelProperty(value = "权限(1.超级管理员 2.普通管理员)",required = true)
  @NotNull(message = "用户权限不能为空")
  private int adminAuthority;

  @ApiModelProperty(value = "创建时间",required = true)
  @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
  private Date adminCreateTime;

  @ApiModelProperty(value = "更新时间",required = true)
  @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
  private Date adminRefreshTime;

  public SystemUserVo(@NotBlank(message = "用户昵称不能为空") String adminNickname) {
    this.adminNickname = adminNickname;
  }
}
